<div class="workplace">  
	<?php echo $template['partials']['loading_ajax']; ?>
	<?php echo $template['partials']['note'];?>
	<div class="row-fluid">
	<div class="span12">
        <div class="head clearfix">
            <div class="isw-list"></div>
            <h1>List Comments</h1>
        </div>
        <div class="block-fluid tabs">

            <ul>
                <!--<li><a href="#tabs-1"><strong>All Comments</strong></a></li>-->
                <li><a href="#tabs-2"><strong>> 20 DISLIKE</strong></a></li>
                                <!-- <li><a href="#tabs-3">Tab 3</a></li> -->
            </ul>                        

            <!--<div id="tabs-1">
                <!-- <div class="row-fluid">
                    <div class="span12">
                        <div class="block-fluid table-sorting clearfix">
                            <table cellpadding="0" cellspacing="0" width="100%" class="table tSortable">
                                <thead>
                                    <tr>                                    
                                        <th width="5%">ID</th>
                                        <th width="55%">Comment</th>
                                        <th width="10%">Added day</th>
                                        <th width="10%">Action</th>                                    
                                    </tr>
                                </thead>
                                <tbody>
                                	<?php if(count($allComments)) : ?>
	                                	<?php foreach($allComments as $cm) : ?>
	                                    <tr id="remove_<?=$cm['id']?>">                                    
	                                        <td><?=$cm['id']?></td>
	                                        <td><?=$cm['comment']?></td>
	                                        <td><?=mdate("%M %d, %Y", $cm['time_added'])?></td>
	                                        <td>
			                        			<a href="javascript:void(0)" onclick="confirm_del('<?=URL_ADMIN?>person/delete_cm/<?=$cm['id']?>', 'remove_<?=$cm['id']?>')" class="icon-trash tip" title="Delete this item"></a>
	                        				</td>                                    
	                                    </tr>
	                                    <?php endforeach ?>
                                	<?php endif ?>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div><!--End tab1-->                        

            <div id="tabs-2">
            	<div class="row-fluid">
                    <div class="span12">
                        <div class="block-fluid table-sorting clearfix">
                            <table cellpadding="0" cellspacing="0" width="100%" class="table tSortable">
                                <thead>
                                    <tr>                                    
                                        <th width="10%">ID</th>
                                        <th width="55%">Comment</th>
                                        <th width="10%">Total of dislike</th>
                                        <th width="10%">Added day</th>
                                        <th width="10%">Action</th>                                    
                                    </tr>
                                </thead>
                                <tbody>
                                	<?php if(count($allComments)) : ?>
	                                	<?php foreach($allComments as $cm) : ?>
                                        <?php $totalDislike = $this->db->query("SELECT SUM(dislike) AS total FROM like_comment WHERE commentId=" . $cm['id'])->row(); ?>
                                        <?php if($totalDislike->total > 20) : ?>
    	                                    <tr id="remove2_<?=$cm['id']?>">                                    
    	                                        <td><?=$cm['id']?></td>
    	                                        <td><?php echo $cm['comment'];?></td>
                                                <td><?=$totalDislike->total?></td>
    	                                        <td><?=mdate("%M %d, %Y", $cm['time_added'])?></td>
    	                                        <td>
    			                        			<a href="javascript:void(0)" onclick="confirm_del('<?=URL_ADMIN?>person/delete_cm/<?=$cm['id']?>', 'remove2_<?=$cm['id']?>')" class="icon-trash tip" title="Delete this item"></a>
    	                        				</td>                                    
    	                                    </tr>
                                        <?php endif ?>
	                                    <?php endforeach ?>
                                	<?php endif ?>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>     
    </div>
    <div class="dr"><span></span></div>

</div>
 